/**
 * 排行榜
 */

<template>
<scroll-view class="boxes" scroll-y="true" >
	<view class="record_head ">
		<image :src="ui.arrowIcon_left" mode=""></image>
		<view class="record_title">
			{{title}}
		</view>
		<image :src="ui.arrowIcon_right" mode=""></image>
	</view>
	<view class="record_item" v-for="(item,index) in dataSort">
		<image class="item_img" :src="ui.record_frist" mode="" v-if="index==0"></image>
		<image class="item_img" :src="ui.record_scend" mode="" v-if="index==1"></image>
		<image class="item_img" :src="ui.record_thrid" mode="" v-if="index==2"></image>
		<view class="item_sort" v-if="index>=3">
			{{index+1}}
		</view>
		<view class="cu-avatar round item_touxiang" :style="{backgroundImage:'url('+ item.touxiang+')'}"></view>
		<view class="item-name">
			{{item.name}}
		</view>
		<view class="item-right">
			已获 <view class="item-price">
				{{item.price}}
			</view> 元
		</view>
	</view>
	<view class="foot">
	
	</view>
	
</scroll-view>


</template>

<script>
	export default{
		name:"rankList",
		data(){
			return{
				
				title: "排行榜",
				ui: this.CON.CON.ui,
				rankList:this.CON.CON.goods.rank_list,
				
			}
		},
		computed:{
			dataSort(){//排行榜的排序
			  return this.rankList.sort(function(a,b){
			  	return b.price-a.price;
			  })
			  
			
			
			}
			
		}
		
		
	
		
		
	}
</script>

<style scoped>
	.boxes{
		max-height: 50vh;
		min-height: 20vh;
	
	
		background-color: white;
	}
	
</style>
